import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
     path: '/main',
     name: 'Main',
     // route level code-splitting
     // this generates a separate chunk (about.[hash].js) for this route
     // which is lazy-loaded when the route is visited.
     component: () => import('../views/Main.vue'),
     children:[
       {
         path: '/menutree',
         name: 'MenuTree',
         // route level code-splitting
         // this generates a separate chunk (about.[hash].js) for this route
         // which is lazy-loaded when the route is visited.
         component: () => import('../views/MenuTree'),
       },
       {
         path: '/users',
         name: 'User',
         // route level code-splitting
         // this generates a separate chunk (about.[hash].js) for this route
         // which is lazy-loaded when the route is visited.
         component: () => import('../views/user/User'),
       },
       {
         path: '/welcome',
         name: 'Index',
         // route level code-splitting
         // this generates a separate chunk (about.[hash].js) for this route
         // which is lazy-loaded when the route is visited.
         component: () => import('../views/index/Index'),
       },
     ],
  },
  /*{
    path: '/lianxi',
    name: 'Lianxi',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/lianxi'),
  },*/
]

const router = new VueRouter({
  routes
})

export default router
